package com.qd.common.panda.domain.entity.score;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 停车场评分
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CarParkScoreDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "评分ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "评分ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String sid;
    /**
     * 分数
     */
    @NotNull(message = "分数不能为空", groups = DefaultGroup.class)
    private Integer score;
    /**
     * 说明
     */
    @Size(max = 100, message = "说明长度不能超过{max}位", groups = DefaultGroup.class)
    private String note;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    @Override
    public void freeData() {
        this.sid = null;
        this.score = null;
        this.note = null;
        this.addTime = null;
        this.updateTime = null;
        super.freeData();
    }
}
